
#ifndef __VM_IOCTRL_H__
#define __VM_IOCTRL_H__

#include "tapi_aci_cmh.h"

#define VM_MAX_NUM_LEN 260
#define VM_MAX_SM_LEN 176
// vmodem command

// IHwMgr

struct VM_RSP_sAT_PlusCGSN {
    char imei[20];
};

struct VM_CMD_sAT_PlusCFUN {
    int fun;
};

struct VM_RSP_qAT_PlusCFUN {
    int fun;
};

struct VM_RSP_qAT_PlusCIMI {
    char cimi[32];
};

struct VM_RSP_qAT_PlusCSQ {
    int csq;
};

struct VM_CMD_sAT_PercentALS {
    int alsMode;
};

struct VM_RSP_qAT_PercentALS {
    int alsMode;
};

struct VM_CMD_sAT_PlusCCLK {
    int   day;
    int   month;
    int   year;
    int   minute;
    int   hour;
    int   second;
    int   format;
    int   PM_flag;
};

struct VM_RSP_qAT_PlusCCLK {
    int   day;
    int   month;
    int   year;
    int   minute;
    int   hour;
    int   second;
    int   format;
    int   PM_flag;
};

// ISimMgr

struct VM_RSP_tAT_PlusCPBR {
    int        firstIdx;
    int        lastIdx;
    int        nlength;
    int        tlength;
};

struct VM_CMD_sAT_PlusCPBR {
    int        location;
    int        startIndex;
    int        count;
};

#define VM_MAX_PHB_NUM_LEN                      (21 * 2)
struct VM_RSP_SCPBR {
    short           index;
    char            number[VM_MAX_PHB_NUM_LEN];
    short           ton;
    short           npi;
    unsigned char   text[64];
    int             textSize;
    unsigned char   line;
};

struct VM_RSP_sAT_PlusCPBR {
    int      count;
    struct VM_RSP_SCPBR entry[1];
};

struct VM_CMD_qAT_PlusCPBS {
    int        location;
};

struct VM_RSP_qAT_PlusCPBS {
    int        used;
    int        total;
};


struct VM_CMD_sAT_PlusCPBW {
    enum {
        cpbw_number = 0x01,
        cpbw_ton = 0x02,
        cpbw_npi = 0x04,
        cpbw_text = 0x08,
        cpbw_line = 0x10,
    };
    int             location;
    short           index;
    short           params;
    char            number[VM_MAX_PHB_NUM_LEN];
    short           ton;
    short           npi;
    unsigned char   text[64];
    int             textSize;
    unsigned char   line;
};

struct VM_RSP_qAT_PlusCPIN {
    int pin;
};

struct VM_CMD_sAT_PlusCPIN {
    char password[32];
    char newPin[32];
};

struct VM_RSP_qAT_PercentPVRF {
    int pin1;
    int pin2;
    int puk1;
    int puk2;
};

struct VM_CMD_qAT_PlusCLCK {
    int fac;
	int class_type;
};

struct VM_RSP_qAT_PlusCLCK {
    int status;
	int class_type;
};

struct VM_CMD_sAT_PlusCLCK {
    enum {
        clck_password = 0x01,
    };
    int params;
    int fac;
    char password[32];
    int active;
	int class_type;
};

struct VM_CMD_sAT_PlusCPWD {
    int fac;
    char oldPwd[32];
    char newPwd[32];
};

struct VM_CMD_qAT_PlusCPMS {
    int location;
};

struct VM_RSP_qAT_PlusCPMS {
    int location;
    short used;
    short total;
};

struct VM_CMD_sAT_PlusCMGL {
    int location;
    short stat;
    short readMode;
};

struct VM_RSP_sAT_PlusCMGL {

};

struct VM_CMD_sAT_PlusCMGR {
    int location;
    short readMode;
    short index;
};

struct VM_RSP_sAT_PlusCMGR {
    typedef enum
    {
      MNSMS_RECORD_FREE              = 0x0,           /* Free record                    */
      MNSMS_RECORD_REC_UNREAD        = 0x3,           /* MT record, not read            */
      MNSMS_RECORD_REC_READ          = 0x1,           /* MT record, already read        */
      MNSMS_RECORD_STO_UNSENT        = 0x7,           /* MO record, not sent            */
      MNSMS_RECORD_STO_SENT          = 0x5,           /* MO record, already sent, status report not requested */
      MNSMS_RECORD_STAT_UNRCVD       = 0xd,           /* MO record, already sent, status report requested, not received */
      MNSMS_RECORD_STAT_UNSTRD       = 0x15,          /* MO record, already sent, status report received, not stored */
      MNSMS_RECORD_STAT_STRD         = 0x1d,          /* MO record, already sent, status report received and stored */
      MNSMS_RECORD_INVALID           = 0xe0           /* The record keeps unrecognizable data */
    }T_MNSMS_VAL_status;
    int location;
    unsigned char status;
    short index;
    unsigned char pdu[176];
    unsigned char len;
};

struct VM_CMD_sAT_PlusCMGD {
    typedef enum
    {
      MNSMS_CMGD_DEL_INDEX           = 0x0,           /* Delete the messages specified by the index. */
      MNSMS_CMGD_DEL_READ            = 0x1,           /* Ignore the index and delete all the read messages. */
      MNSMS_CMGD_DEL_READ_SENT       = 0x2,           /* Ignore the index and delete all the read and sent messages. */
      MNSMS_CMGD_DEL_READ_SENT_UNSENT = 0x3,          /* Ignore the index and delete all the read, send and unsent messages. */
      MNSMS_CMGD_DEL_ALL             = 0x4            /* Ignore the index and delete all the messages whatever the status it is. */
    }T_MNSMS_VAL_Status;
    int location;
    short index;
    short mode;
};

struct VM_CMD_sAT_PlusCSIM {
    int dataLen;
    unsigned char data[262];
};

struct VM_RSP_sAT_PlusCSIM {
    int rspLen;
    unsigned char rsp[262];
};

struct VM_CMD_sAT_PlusCRSM {
    int            cmd;
    short          fileId;
    short          p1;
    short          p2;
    short          p3;
    short          dataLen;
    unsigned char  data[256];
};

struct VM_RSP_sAT_PlusCRSM {
    int rspLen;
    short sw1;
    short sw2;
    unsigned char rsp[262];
};

// sms
struct VM_CMD_sAT_PlusCNMI {
    int sm;
    int cbm;
    int ds;
};

struct VM_RSP_qAT_PlusCNMI {
    int sm;
    int cbm;
    int ds;
};

struct VM_CMD_sAT_PlusCMGS {
    unsigned char data[176];
    unsigned char len;
};

struct VM_RSP_sAT_PlusCMGS {
    unsigned char mr;
};

struct VM_RSP_qAT_PlusCSCA {
    char sca[32];
    unsigned char tosca;
};

struct VM_RSP_qAT_PlusCSCB {
    typedef struct
    {
      unsigned short            mid_start_range;          /*<  0:  2> Start Range*/
      unsigned short            mid_end_range;            /*<  2:  2> End Range*/
    } T_CBM_message_id_ranges;

    typedef struct
    {
      unsigned char             dcs_start_range;          /*<  0:  1> Start Range*/
      unsigned char             dcs_end_range;            /*<  1:  1> End Range*/
      unsigned char             zzz_align0;               /*<  2:  1> alignment*/
      unsigned char             zzz_align1;               /*<  3:  1> alignment*/
    } T_CBM_coding_scheme_ranges;

    int mode;
    unsigned char c_mids;
    T_CBM_message_id_ranges mids[0x14 + 1];
    unsigned char c_dcss;
    T_CBM_coding_scheme_ranges dcss[0x14 + 1];
};

struct VM_CMD_sAT_PlusCSCA {
    char sca[32];
    unsigned char tosca;
};

struct VM_CMD_sAT_PlusCSCB {
    typedef struct
    {
      unsigned short            mid_start_range;          /*<  0:  2> Start Range*/
      unsigned short            mid_end_range;            /*<  2:  2> End Range*/
    } T_CBM_message_id_ranges;

    typedef struct
    {
      unsigned char             dcs_start_range;          /*<  0:  1> Start Range*/
      unsigned char             dcs_end_range;            /*<  1:  1> End Range*/
      unsigned char             zzz_align0;               /*<  2:  1> alignment*/
      unsigned char             zzz_align1;               /*<  3:  1> alignment*/
    } T_CBM_coding_scheme_ranges;

    int mode;
    T_CBM_message_id_ranges mids[0x14 + 1];
    T_CBM_coding_scheme_ranges dcss[0x14 + 1];
};

// tapi
struct VM_RSP_qAT_PlusCOPS {
    short mode;
    short format;
    char numName[32];
};

struct VM_CMD_sAT_PlusCOPS {
    enum {
        cops_name = 0x01,
    };
    int params;
    int mode;
    int format;
    char name[32];
};

struct VM_CMD_sAT_PlusCMUT {
	short mute;
};

struct VM_RSP_qAT_PlusCMUT {
	short mute;
};

struct VM_CMD_sAT_PlusVTS {
    char             dtmf;
    short           duration;
};

struct VM_CMD_sAT_PlusCCWA {
    int    mode;
    int    class_type;
};

struct VM_CMD_qAT_PlusCCWA {
    int    class_type;
};

struct VM_RSP_qAT_PlusCCWA {
    int status;
    int class_type;
};

struct VM_RSP_qAT_PlusCOLP {
    int stat;
};

struct VM_RSP_qAT_PlusCLIP {
    int stat;
};

struct VM_CMD_sAT_PlusCLIR {
    int mode;
};

struct VM_RSP_qAT_PlusCLIR {
    int mode;
    int stat;
};

struct VM_CMD_sAT_PlusCCFC {
    int reason;
    int mode;
    char number[VM_MAX_NUM_LEN];
    int ton;
    int npi;
    int class_type;
    char subaddr[VM_MAX_NUM_LEN];
    int tos;
    int oe;
    int time;
};

struct VM_CMD_qAT_PlusCCFC {
    int  reason;
    int  class_type;
};

struct VM_RSP_qAT_PlusCCFC {
  int status;
  int class_type;
  char number[VM_MAX_NUM_LEN];
  int ton;
  int npi;
  char subaddr[VM_MAX_NUM_LEN];
  int tos;
  int oe;
  int time;
};

struct VM_RSP_tAT_PlusCOPS {
  int count;
  T_ACI_COPS_OPDESC oper[MMREG_MAX_PLMN_ID];
};

struct VM_CMD_sAT_PlusCPOL {
  T_ACI_CPOL_OPDESC oper;
};

struct VM_RSP_qAT_PlusCPOL {
  int count;
  T_ACI_CPOL_OPDESC oper[100];
};

struct VM_RSP_qAT_PercentCREG {
  int stat;
  int accTech;
};

struct VM_RSP_qAT_PlusCLCC {
    int idx;
    int dir;
    int stat;
    int mode;
    int mpty;
    int class_type;
    char number[VM_MAX_NUM_LEN];
    int type;
    char alpha[21];
};
typedef struct VM_RSP_qAT_PlusCLCC TAPI_VMRSP_CLCC_LIST[7];

struct VM_CMD_sAT_Dn {
    char             phoneNumer[VM_MAX_NUM_LEN];
};

struct VM_CMD_sAT_Abort {
    int cmdId;
};

struct VM_CMD_sAT_PlusCHLD {
    enum {
        chld_call = 0x01,
    };
    int   mode;
    unsigned char params;
    char  call[5];
};

struct VM_RSP_qAT_PlusCGREG {
    int             stat;
};

struct VM_CMD_sAT_PlusCGDCONT {
#define MAX_PDP_CONTEXT_TYPE_LEN        7
#define PDP_CONTEXT_APN_LEN_MAX         103
#define NAS_SIZE_IPv4_ADDR             (0x4)
#define NAS_SIZE_IPv6_ADDR             (0x10)
    typedef char T_PDP_CONTEXT_PDP_TYPE[MAX_PDP_CONTEXT_TYPE_LEN];
    typedef char T_PDP_CONTEXT_APN[PDP_CONTEXT_APN_LEN_MAX];
    typedef enum
    {
      NAS_is_ip_not_present          = 0x0,
      NAS_is_ipv4                    = 0x1,
      NAS_is_ipv6                    = 0x2
    }T_NAS_ctrl_ip_address;
    typedef struct
    {
      unsigned char             a4[NAS_SIZE_IPv4_ADDR];   /*<  0:  4> IPv4 Address Values                                */
    } T_NAS_ipv4_addr;
    typedef struct
    {
      unsigned char             a6[NAS_SIZE_IPv6_ADDR];   /*<  0: 16> IPv6 Address Values                                */
    } T_NAS_ipv6_addr;
    typedef union
    {
      unsigned int              ip_not_present;           /*<  0:  4> IP address not present                             */
      T_NAS_ipv4_addr           ipv4_addr;                /*<  0:  4> IPv4 Address Type                                  */
      T_NAS_ipv6_addr           ipv6_addr;                /*<  0: 16> IPv6 Address Type                                  */
    } T_NAS_ip_address;
    typedef struct
    {
      T_NAS_ctrl_ip_address     ctrl_ip_address;          /*<  0:  4> (enum=32bit) controller for union                  */
      T_NAS_ip_address          ip_address;               /*<  4: 16> IP Address                                         */
    } T_NAS_ip;
    typedef struct
    {
      T_PDP_CONTEXT_PDP_TYPE pdp_type;
      T_PDP_CONTEXT_APN      pdp_apn;
      T_NAS_ip               pdp_addr;
      unsigned char          d_comp;  /* T_PDP_CONTEXT_D_COMP */
      unsigned char          h_comp;  /* T_PDP_CONTEXT_H_COMP */
      unsigned char          p_cid;   /* Primary PDP context id, used if the context is a secondary PDP context */
    } T_PDP_CONTEXT;
    int cid;
    T_PDP_CONTEXT pdp_context;
};


struct VM_CMD_sAT_PlusCGACT {
    int state;
    int cid;
};
struct VM_CMD_sAT_PercentCGPCO {
    unsigned char cid;
    unsigned short protocol;
    char user[64];
    char pwd[64];
    char dns1[16];
    char dns2[16];
};

struct VM_CMD_sAT_PlusCGATT {
    int state;
};

struct VM_CMD_qAT_PlusCGATT {
    int state;
};

//stk
struct VM_CMD_sAT_PercentSATC {
    int             cfg;
	char            satProfile[256];
	int             length;
};

struct VM_CMD_sAT_PercentSATE {
	char            satCmd[256];
	int             length;
};

struct VM_CMD_sAT_PercentSATR {
	char            satRsp[256];
	int             length;
};

struct VM_CMD_sAT_PercentSATT {
	int             cause;
};

struct VM_CMD_sAT_PlusCMGW {
    short            index;
    char             address[256];
    short            ton;
    short            npi;
    short            stat;
    short            msg_ref;
    char             data[512];
    int              len;
    char             sca[256];
    short            sca_ton;
    short            sca_npi;
};

struct VM_CMD_sAT_PlusCMGWPdu {
    short            stat;
    char             pdu[VM_MAX_SM_LEN];
    int              len;
};

struct VM_RSP_sAT_PlusCMGW {
   int              index;
   int              numSeg;
};

struct VM_CMD_sAT_PlusCUSD {
  char  data[183];
  short len;
  short dcs;
  int   state;
};

typedef union VM_COMMAND {
    struct VM_CMD_sAT_PlusCFUN          sAT_PlusCFUN;
    struct VM_CMD_sAT_PercentALS        sAT_PercentALS;
    struct VM_CMD_sAT_PlusCCLK          sAT_PlusCCLK;

    struct VM_CMD_sAT_PlusCPBR          sAT_PlusCPBR;
    struct VM_CMD_qAT_PlusCPBS          qAT_PlusCPBS;
    struct VM_CMD_sAT_PlusCPBW          sAT_PlusCPBW;
    struct VM_CMD_sAT_PlusCPIN          sAT_PlusCPIN;
    struct VM_CMD_qAT_PlusCLCK          qAT_PlusCLCK;
    struct VM_CMD_sAT_PlusCLCK          sAT_PlusCLCK;
    struct VM_CMD_sAT_PlusCPWD          sAT_PlusCPWD;
    struct VM_CMD_qAT_PlusCPMS          qAT_PlusCPMS;
    struct VM_CMD_sAT_PlusCMGL          sAT_PlusCMGL;
    struct VM_CMD_sAT_PlusCMGR          sAT_PlusCMGR;
    struct VM_CMD_sAT_PlusCMGD          sAT_PlusCMGD;
    struct VM_CMD_sAT_PlusCSIM          sAT_PlusCSIM;
    struct VM_CMD_sAT_PlusCRSM          sAT_PlusCRSM;
    struct VM_CMD_sAT_PlusCMGW          sAT_PlusCMGW;
    struct VM_CMD_sAT_PlusCMGWPdu       sAT_PlusCMGWPdu;
    struct VM_CMD_sAT_PlusCUSD          sAT_PlusCUSD;

    struct VM_CMD_sAT_PlusCNMI          sAT_PlusCNMI;
    struct VM_CMD_sAT_PlusCMGS          sAT_PlusCMGS;
    struct VM_CMD_sAT_PlusCSCA          sAT_PlusCSCA;
    struct VM_CMD_sAT_PlusCSCB          sAT_PlusCSCB;

    struct VM_CMD_sAT_PlusCOPS          sAT_PlusCOPS;
	struct VM_CMD_sAT_PlusCMUT          sAT_PlusCMUT;
    struct VM_CMD_sAT_PlusVTS           sAT_PlusVTS;
	struct VM_CMD_sAT_PlusCCWA          sAT_PlusCCWA;
    struct VM_CMD_qAT_PlusCCWA          qAT_PlusCCWA;
    struct VM_CMD_sAT_PlusCLIR          sAT_PlusCLIR;
    struct VM_CMD_sAT_PlusCCFC          sAT_PlusCCFC;
    struct VM_CMD_qAT_PlusCCFC          qAT_PlusCCFC;
	struct VM_CMD_sAT_PlusCPOL          sAT_PlusCPOL;

    struct VM_CMD_sAT_Dn                sAT_Dn;
    struct VM_CMD_sAT_Abort             sAT_Abort;
    struct VM_CMD_sAT_PlusCHLD          sAT_PlusCHLD;

    struct VM_CMD_sAT_PlusCGDCONT       sAT_PlusCGDCONT;
    struct VM_CMD_sAT_PlusCGACT         sAT_PlusCGACT;
    struct VM_CMD_sAT_PercentCGPCO      sAT_PercentCGPCO;
    struct VM_CMD_sAT_PlusCGATT         sAT_PlusCGATT;

	struct VM_CMD_sAT_PercentSATC	    sAT_PercentSATC;
	struct VM_CMD_sAT_PercentSATE       sAT_PercentSATE;
	struct VM_CMD_sAT_PercentSATR       sAT_PercentSATR;
	struct VM_CMD_sAT_PercentSATT       sAT_PercentSATT;
} VM_COMMAND;

typedef union VM_RESPONSE {
    struct VM_RSP_sAT_PlusCGSN          sAT_PlusCGSN;
    struct VM_RSP_qAT_PlusCFUN          qAT_PlusCFUN;
    struct VM_RSP_qAT_PlusCIMI          qAT_PlusCIMI;
    struct VM_RSP_qAT_PercentALS        qAT_PercentALS;
    struct VM_RSP_qAT_PlusCCLK          qAT_PlusCCLK;

    struct VM_RSP_qAT_PlusCSQ           qAT_PlusCSQ;
    struct VM_RSP_tAT_PlusCPBR          tAT_PlusCPBR;
    struct VM_RSP_sAT_PlusCPBR          sAT_PlusCPBR;
    struct VM_RSP_qAT_PlusCPBS          qAT_PlusCPBS;
    struct VM_RSP_qAT_PlusCPIN          qAT_PlusCPIN;
    struct VM_RSP_qAT_PercentPVRF       qAT_PercentPVRF;
    struct VM_RSP_qAT_PlusCLCK          qAT_PlusCLCK;
    struct VM_RSP_qAT_PlusCPMS          qAT_PlusCPMS;
    struct VM_RSP_sAT_PlusCMGL          sAT_PlusCMGL;
    struct VM_RSP_sAT_PlusCMGR          sAT_PlusCMGR;
    struct VM_RSP_sAT_PlusCSIM          sAT_PlusCSIM;
    struct VM_RSP_sAT_PlusCRSM          sAT_PlusCRSM;
    struct VM_RSP_sAT_PlusCMGW          sAT_PlusCMGW;

    struct VM_RSP_qAT_PlusCNMI          qAT_PlusCNMI;
    struct VM_RSP_sAT_PlusCMGS          sAT_PlusCMGS;
    struct VM_RSP_qAT_PlusCSCA          qAT_PlusCSCA;
    struct VM_RSP_qAT_PlusCSCB          qAT_PlusCSCB;

    struct VM_RSP_qAT_PercentCREG       qAT_PercentCREG;
    struct VM_RSP_qAT_PlusCOPS          qAT_PlusCOPS;
	struct VM_RSP_qAT_PlusCMUT          qAT_PlusCMUT;
    struct VM_RSP_qAT_PlusCLCC          qAT_PlusCLCC[7];
    struct VM_RSP_qAT_PlusCCWA          qAT_PlusCCWA;
    struct VM_RSP_qAT_PlusCOLP          qAT_PlusCOLP;
    struct VM_RSP_qAT_PlusCLIP          qAT_PlusCLIP;
    struct VM_RSP_qAT_PlusCLIR          qAT_PlusCLIR;
    struct VM_RSP_qAT_PlusCCFC          qAT_PlusCCFC;
    struct VM_RSP_tAT_PlusCOPS          tAT_PlusCOPS;
    struct VM_RSP_qAT_PlusCPOL          qAT_PlusCPOL;

    struct VM_RSP_qAT_PlusCGREG         qAT_PlusCGREG;
    struct VM_CMD_qAT_PlusCGATT         qAT_PlusCGATT;
} VM_RESPONSE;

typedef enum {
    VM_IOCTRL_UNDEFINED = 0,

    VM_IOCTRL_sAT_PlusCFUN = 0x100,
    VM_IOCTRL_qAT_PlusCFUN,
    VM_IOCTRL_qAT_PlusCIMI,
    VM_IOCTRL_qAT_PlusCSQ,
    VM_IOCTRL_sAT_PercentALS,
    VM_IOCTRL_qAT_PercentALS,
    VM_IOCTRL_sAT_PlusCGSN,
    VM_IOCTRL_sAT_PlusCCLK,
    VM_IOCTRL_qAT_PlusCCLK,

    VM_IOCTRL_tAT_PlusCPBR = 0x200,
    VM_IOCTRL_sAT_PlusCPBR,
    VM_IOCTRL_qAT_PlusCPBS,
    VM_IOCTRL_qAT_PlusCPIN,
    VM_IOCTRL_sAT_PlusCPBW,
    VM_IOCTRL_sAT_PlusCPIN,
    VM_IOCTRL_qAT_PercentPVRF,
    VM_IOCTRL_qAT_PlusCLCK,
    VM_IOCTRL_sAT_PlusCLCK,
    VM_IOCTRL_sAT_PlusCPWD,
    VM_IOCTRL_qAT_PlusCPMS,
    VM_IOCTRL_sAT_PlusCMGL,
    VM_IOCTRL_sAT_PlusCMGR,
    VM_IOCTRL_sAT_PlusCMGD,
    VM_IOCTRL_sAT_PlusCSIM,
    VM_IOCTRL_sAT_PlusCRSM,

    // sms
    VM_IOCTRL_sAT_PlusCNMI = 0x300,
    VM_IOCTRL_qAT_PlusCNMI,
    VM_IOCTRL_sAT_PlusCMGS,
    VM_IOCTRL_qAT_PlusCSCA,
    VM_IOCTRL_sAT_PlusCSCA,
    VM_IOCTRL_sAT_PlusCMGW,
    VM_IOCTRL_sAT_PlusCMGWPdu,
    VM_IOCTRL_sAT_PlusCUSD,
    VM_IOCTRL_sAT_PlusCSCB,
    VM_IOCTRL_qAT_PlusCSCB,

	//TAPI
    VM_IOCTRL_TAPI_Init_E = 0x400,
    VM_IOCTRL_TAPI_SetDTMFTime_N,
    VM_IOCTRL_TAPI_GetDTMFTime_N,
	VM_IOCTRL_TAPI_SetAudioChannel_N,
	VM_IOCTRL_TAPI_GetAudioChannel_N,
	VM_IOCTRL_sAT_PlusCMUT,
	VM_IOCTRL_qAT_PlusCMUT,
	VM_IOCTRL_sAT_PlusVTS,
    VM_IOCTRL_qAT_PercentCREG,
    VM_IOCTRL_sAT_PlusCOPS,
    VM_IOCTRL_qAT_PlusCOPS,
	VM_IOCTRL_qAT_CLCC,
	VM_IOCTRL_sAT_PlusCCWA,
    VM_IOCTRL_qAT_PlusCCWA,
    VM_IOCTRL_qAT_PlusCOLP,
    VM_IOCTRL_qAT_PlusCLIP,
    VM_IOCTRL_sAT_PlusCLIR,
    VM_IOCTRL_qAT_PlusCLIR,
    VM_IOCTRL_sAT_PlusCCFC,
    VM_IOCTRL_qAT_PlusCCFC,
    VM_IOCTRL_tAT_PlusCOPS,
    VM_IOCTRL_sAT_PlusCPOL,
    VM_IOCTRL_qAT_PlusCPOL,

    // call
    VM_IOCTRL_sAT_Dn = 0x500,
	VM_IOCTRL_sAT_Abort,
	VM_IOCTRL_sAT_H,
	VM_IOCTRL_sAT_PlusCHUP,
	VM_IOCTRL_sAT_PlusCHLD,
	VM_IOCTRL_sAT_A,
	VM_IOCTRL_sAT_SAT_A,
	VM_IOCTRL_sAT_SAT_H,

    // GPRS
    VM_IOCTRL_qAT_PlusCGREG = 0x600,
    VM_IOCTRL_qAT_PlusCGDCONT,
    VM_IOCTRL_sAT_PlusCGDCONT,
    VM_IOCTRL_sAT_Dn_GPRS,
    VM_IOCTRL_sAT_PlusCGACT,
    VM_IOCTRL_sAT_PercentCGPCO,
    VM_IOCTRL_sAT_PlusCGATT,
    VM_IOCTRL_qAT_PlusCGATT,

	/*
	VM_IOCTRL_GPRS_Init_E,
	VM_IOCTRL_GPRS_SetServiceFlux_S,
	VM_IOCTRL_GPRS_SetServiceFluxMin_S,
	VM_IOCTRL_GPRS_RequestService_E,
    */

	//stk
	VM_IOCTRL_sAT_PercentSATC = 0x700,
	VM_IOCTRL_sAT_PercentSATE,
	VM_IOCTRL_sAT_PercentSATR,
	VM_IOCTRL_sAT_PercentSATT,

    VM_IOCTRL_START = 0x1000,
    VM_IOCTRL_EXIT,
    VM_IOCTRL_SyncTimeEnabled,
    VM_IOCTRL_SyncTimeDisabled,
    VM_IOCTRL_MAX,
} VM_IOCTRL;


// vmodem indicator

enum VM_INDT {
    VM_INDT_NONE,
    VM_INDT_PercentCPI,
    VM_INDT_PlusCRING,
    VM_INDT_PercentCREG,
    VM_INDT_PercentCSQ,
    VM_INDT_PlusCMT,
    VM_INDT_PlusCMTI,
    VM_INDT_PlusCDS,
    VM_INDT_PlusCBM,
    VM_INDT_PlusCUSD,
    VM_INDT_PlusCGREG,
    VM_INDT_PercentSATI,
    VM_INDT_PercentSATE,
    VM_INDT_PercentSATA,
    VM_INDT_PercentSATN,
    VM_INDT_PlusCCWA,
    VM_INDT_SignalSMS,
    VM_INDT_PhbStatus,
    VM_INDT_PlusCGEREP,
    VM_INDT_PlusCME,
    VM_INDT_PlusCMS,
    VM_INDT_PercentSIMREM,
    VM_INDT_PlusCCLK,
};

struct VM_IND_PercentCPI {
    int cId, msgType, ibt, tch, cause;
};

struct VM_IND_PercentCREG {
    int registerStatus;
    int lac;
    int ci;
    int rt;
};

struct VM_IND_PercentCSQ {
    int rssi;
    int ber;
    int actlevel;
};

struct VM_IND_PlusCMT {
    unsigned char data[176];
    unsigned char len;
};

struct VM_IND_PlusCMTI {
    int  mem;
    unsigned char index;
};

struct VM_IND_PlusCDS {
    unsigned char data[176];
    unsigned char len;
};

struct VM_IND_PlusCBM {
    unsigned char data[94];
    unsigned char len;
};

struct VM_IND_PlusCUSD {
    int m;
    unsigned char data[183];
    unsigned char len;
    short dcs;
};

struct VM_IND_PlusCGREG {
    int registerStatus;
    int lac;
    int ci;
};

struct VM_IND_PercentSATI{
	char satCmd[256];
	int  length;
};

struct VM_IND_PercentSATE{
	char satRsp[256];
	int  length;
};

struct VM_IND_PercentSATA{
	int rdl;
};

struct VM_IND_PercentSATN {
	char            satNtfy[256];
	int             length;
	int             ctrlType;
};

struct VM_IND_PlusCCWA {
    char      number[VM_MAX_NUM_LEN];
    int       toa;
    int       npi;
//    U8          validity,
//    T_ACI_CLASS     call_class,
};

struct VM_IND_SignalSMS {
    int status;
};

struct VM_IND_PhbStatus {
    int status;
};

struct VM_IND_PlusCGEREP {
    int event;
    short cid;
};

struct VM_IND_PlusCME {
    int cmdId;
    int err;
};

struct VM_IND_PlusCMS {
    int cmdId;
    int err;
};

struct VM_IND_PercentSIMREM {
    int srType;
};

struct VM_IND_PlusCCLK {
    int   flag;	/* 0: failed; 1: successful */
    int   day;
    int   month;
    int   year;
    int   minute;
    int   hour;
    int   second;
};

typedef union VM_INDICATOR_DATA {
    struct VM_IND_PercentCPI            PercentCPI;
    struct VM_IND_PercentCREG           PercentCREG;
    struct VM_IND_PercentCSQ            PercentCSQ;
    struct VM_IND_PlusCMT               PlusCMT;
    struct VM_IND_PlusCMTI              PlusCMTI;
    struct VM_IND_PlusCDS               PlusCDS;
    struct VM_IND_PlusCBM               PlusCBM;
    struct VM_IND_PlusCUSD              PlusCUSD;
    struct VM_IND_PlusCGREG             PlusCGREG;
    struct VM_IND_PercentSATI           PercentSATI;
    struct VM_IND_PercentSATE           PercentSATE;
    struct VM_IND_PercentSATA           PercentSATA;
    struct VM_IND_PercentSATN           PercentSATN;
    struct VM_IND_PlusCCWA              PlusCCWA;
    struct VM_IND_SignalSMS             SignalSMS;
    struct VM_IND_PhbStatus             PhbStatus;
    struct VM_IND_PlusCGEREP            PlusCGEREP;
    struct VM_IND_PlusCME               PlusCME;
    struct VM_IND_PlusCMS               PlusCMS;
    struct VM_IND_PercentSIMREM         PercentSIMREM;
    struct VM_IND_PlusCCLK              PlusCCLK;
} VM_INDICATOR_DATA;

typedef struct VM_INDICATOR {
    VM_INDT type;
    VM_INDICATOR_DATA data;
} VM_INDICATOR;

#endif /* __VM_IOCTRL_H__ */

